/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package za.ac.cput.isp.obey;

import za.ac.cput.isp.obey.service.BankImplObey;
import za.ac.cput.isp.conf.BankConfObey;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.ApplicationContext;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

/**
 *
 * @author Jameel
 */
public class ISPJUnitTestObey {
    
    private static ApplicationContext ctx;
    private static BankImplObey bank;
    
    
    public ISPJUnitTestObey() {
    }

    @BeforeClass
    public static void setUpClass() throws Exception {
        ctx = new AnnotationConfigApplicationContext(BankConfObey.class);
        bank = (BankImplObey)ctx.getBean("bank1");
    }

    @AfterClass
    public static void tearDownClass() throws Exception {
    }
    
    @Before
    public void setUp() {
    }
    
    @After
    public void tearDown() {
    }
    // TODO add test methods here.
    // The methods must be annotated with annotation @Test. For example:
    //
    @Test
    public void bank() {
        BankImplObey myBank = new BankImplObey();
        
        myBank.setBal(10000);
        
        Assert.assertEquals(10000, myBank.balance(), 0.0);
    }
}
